// https://min.erkantv.cn:443/han/hanJuji

import {
	request
} from "@/utils/request.js";


// 会员金额
export function coinAlpay() {
	return request({
		url: '/collectionAlpay'
	});

}

// 微信JSAPI支付
export function wechatJsapiPay(data) {
	return request({
		url: '/api/pay/wechat/jsapi',
		method: 'POST',
		data
	});
}

// 查询支付结果
export function checkPayResult(orderId) {
	return request({
		url: `/api/pay/wechat/result/${orderId}`,
		method: 'GET'
	});
}


// 获取抽奖奖品详细
export function getLotteryPrizes() {
	return request({
		url: '/prizes/all',
		method: 'GET'
	});
}

// 获取抽奖用户和抽奖历史记录
export function getLotteryPrizesUser(userId) {
	return request({
		url: '/prizesUser/getPrizes',
		data: {
			pageNum : 1,
			pageSize : 30,
			userId: userId
		}
	});
}

// 存储抽奖用户信息
export function saveLotteryPrizes(userId, username, imageUrl, prizes) {
		return request({
		url: '/prizesUser/insert',
		data: {
			userId : userId,
			username : username,
			imageUrl : imageUrl,
			prizes : prizes,
			gmtCreate : new Date().getTime()
		}
	});
}
